fadeOut

open fun fadeOut(@NonNull target: View)

Fades out the target View from fully opaque (alpha 1) to fully transparent (alpha 0) using the default duration of {@value #DEFAULT_FADE_DURATION} milliseconds.

Parameters

target

The View to animate. Must not be null.


open fun fadeOut(@NonNull target: View, duration: Long)

Fades out the target View from fully opaque (alpha 1) to fully transparent (alpha 0).

Parameters

target

The View to animate. Must not be null.

duration

The duration of the animation in milliseconds. Must be non-negative.


open fun fadeOut(@NonNull target: View, duration: Long, @Nullable listener: Animator.AnimatorListener)

Fades out the target View from fully opaque (alpha 1) to fully transparent (alpha 0).

Parameters

target

The View to animate. Must not be null.

duration

The duration of the animation in milliseconds. Must be non-negative.

listener

An optional AnimatorListener to receive animation lifecycle events. Can be null.

Throws

if duration is negative.